package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author 江峰
 * @Date 2024/6/7 16:44
 * @packageName:com.sky.mapper
 * @ClassName:OrderDetailMapper
 */
@Mapper
public interface OrderDetailMapper {
    /**
     * 批量插入订单详细信息
     * @param orderDetailList
     */
    void insertBatch(List<OrderDetail> orderDetailList);

    /**
     * 根据订单id查询订单明细
     * @param ordersId
     * @return
     */
    @Select("select *from sky_take_out.order_detail where order_id=#{ordersId}")
    List<OrderDetail> getByOrderId(Long ordersId);
}
